package Enum_;

/**
 * @author 王艺锡
 * @version 1.0
 * Enum关键字的学习
 */
public class Enumeration01 {
    public static void main(String[] args) {
        System.out.println(Season02.SPRING);
        System.out.println(Season02.SUMMER);
        System.out.println(Season02.AUTUMN);
        System.out.println(Season02.WINTER);
    }
}

enum Season02{
    //如果使用enum枚举代替class
    //枚举对象必须放在枚举类的行首
    SPRING("春天","温暖"),
    SUMMER("夏天","炎热"),
    AUTUMN("秋天","凉爽"),
    WINTER("冬天","寒冷"),//调用有参构造器
    AA,
    BB;//调用无参构造器

    private String name;
    private String desc;


    private Season02(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    Season02() {
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public String toString() {
        return "Season{" +
                "name='" + name + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }
}

